package com.aistar.service.impl;

import com.aistar.mapper.HonorMapper;
import com.aistar.mapper.SkillMapper;
import com.aistar.pojo.Honor;
import com.aistar.pojo.HonorExample;
import com.aistar.pojo.Skill;
import com.aistar.pojo.SkillExample;
import com.aistar.service.SkillService;
import com.aistar.util.MyBatisUtil;
import com.aistar.util.ServerResponse;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class SkillServiceImpl implements SkillService {
    @Override
    public ServerResponse getAllByResumeId(Integer resumeId) {
        SqlSession sqlSession = MyBatisUtil.getSqlSession();
        SkillMapper mapper =   sqlSession.getMapper(SkillMapper.class);
        SkillExample example = new SkillExample();

        example.createCriteria().andResumeIdEqualTo(resumeId).andStatusEqualTo(0);

        List<Skill> skillList =  mapper.selectByExample(example);
        if(skillList!=null && skillList.size() >0)
            return ServerResponse.getDataSuccess(skillList);
        return ServerResponse.getDataFailed("暂无专业技能");
    }

    @Override
    public ServerResponse save(Skill skill) {
        return null;
    }

    @Override
    public ServerResponse modifyStatus(Skill skill) {
        return null;
    }

    @Override
    public ServerResponse modify(Skill skill) {
        return null;
    }

    @Override
    public ServerResponse getById(Integer id) {
        return null;
    }

    @Override
    public ServerResponse getAll() {
        return null;
    }
}
